package logic

import (
	"context"
	"product-module/product-rpc/proto/good"
	"product-module/product-service/server"
)

type GoodServer struct {
	good.UnimplementedGoodServer
}

func (g GoodServer) GoodCreate(ctx context.Context, in *good.GoodCreateReq) (*good.GoodCreateResp, error) {
	create, err := server.GoodCreate(in)
	if err != nil {
		return nil, err
	}
	return create, nil
}

func (g GoodServer) Sttribute(ctx context.Context, in *good.SttributeReq) (*good.SttributeResp, error) {
	sttribute, err := server.Sttribute(in)
	if err != nil {
		return nil, err
	}
	return sttribute, nil
}

func (g GoodServer) Sales(ctx context.Context, in *good.SalesReq) (*good.SalesResp, error) {
	sales, err := server.Sales(in)
	if err != nil {
		return nil, err
	}
	return sales, nil
}

func (g GoodServer) GoodList(ctx context.Context, in *good.GoodListReq) (*good.GoodListResp, error) {
	list, err := server.GoodList(in)
	if err != nil {
		return nil, err
	}
	return list, nil

}

func (g GoodServer) GoodFind(ctx context.Context, in *good.GoodFindReq) (*good.GoodListResp, error) {
	find, err := server.GoodFind(in)
	if err != nil {
		return nil, err
	}
	return find, nil
}
